// pages/我发布的/我发布的.js
Page({
  data: {
    list: [],
    label_selected: 0,
    whether_show: false
  },

  onLoad(){
    const that = this
    const app = getApp()
    wx.request({
      url: app.globalData.root_url + 'list_created_projects/?user_id=' + app.globalData.user_id,
      method: 'GET',
      success(res) {
        that.setData({
          list: res.data,
          whether_show: res.data[0][0].length + res.data[0][1].length === 0
        })
      }
    })
  },

  // 页面顶部标签切换
  志愿者招募(){
    this.setData({
      label_selected: 0
    })
  },
  学术支持(){
    this.setData({
      label_selected: 1
    })
  },
  其他(){
    this.setData({
      label_selected: 2
    })
  },

  项目内容(event){
    wx.navigateTo({
      url: '/pages/项目内容/项目内容?project_id=' + JSON.stringify(event.currentTarget.dataset.content)
    })
  }
})